home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / OpenOffice.idb / usr / OpenOffice / help / en / sbasic.jar / text / sbasic / common / 03020414.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  2.7 KB  |  43 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>SetAttr Statement [Runtime]</title><meta name="filename" content="text/sbasic/common/03020414"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         p.P1{
  5.                 }
  6.         p.P2{
  7.                 }
  8.         span.T1{
  9.                 font-weight:bold;}
  10.         </style></head><body>
  11.   
  12.   
  13.   <help:to-be-embedded Eid="setattr" xmlns:help="http://openoffice.org/2000/help">
  14.   <p class="Head1"><help:link Id="66554">SetAttr Statement [Runtime]</help:link></p>
  15.   <p class="Paragraph">Sets the attribute information for a specified file.</p>
  16.   </help:to-be-embedded>
  17.   <p class="Paragraph"><span class="T1">Syntax</span>:</p>
  18.   <p class="Paragraph">SetAttr FileName As String, Attribute As Integer <help:key-word value="SetAttr" tag="kw66554_1" xmlns:help="http://openoffice.org/2000/help"/></p>
  19.   <p class="Paragraph"><span class="T1">Parameter</span>:</p>
  20.   <p class="Paragraph">FileName: Name of the file, including path, for which to test attributes. If no path specification is given, <span class="T1">SetAttr</span> <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>searches for the file in the current directory. The <help:link Id="66636" Eid="urllocal" xmlns:help="http://openoffice.org/2000/help">URL notation</help:link> can also be used here.</p>
  21.   <p class="Paragraph">Attribute: Bit pattern defining the attributes to be set or to be cleared:</p>
  22.   <p class="P2">Value</p>
  23.   <p class="Paragraph">0 : Normal files.</p>
  24.   <p class="Paragraph">1 : Read-only files.</p>
  25.   <p class="Paragraph">2 : Hidden files.</p>
  26.   <p class="Paragraph">4 : System files.</p>
  27.   <p class="Paragraph">32 : File was changed since last backup (Archive bit).</p>
  28.   <p class="Paragraph">You can set multiple attributes by combining the respective values with a logic OR statement.</p>
  29.   <p class="P2">Example:</p>
  30.   <p class="PropText">Sub ExampleSetGetAttr</p>
  31.   <p class="PropText">On Error Goto ErrorHandler REM Define target for error-handler</p>
  32.   <p class="PropText">If Dir("C:\test",16)="" Then MkDir "C:\test"</p>
  33.   <p class="PropText">If Dir("C:\test\autoexec.sav")="" THEN Filecopy "c:\autoexec.bat", "c:\test\autoexec.sav"</p>
  34.   <p class="PropText">SetAttr "c:\test\autoexec.sav" ,0</p>
  35.   <p class="PropText">Filecopy "c:\autoexec.bat", "c:\test\autoexec.sav"</p>
  36.   <p class="PropText">SetAttr "c:\test\autoexec.sav" ,1</p>
  37.   <p class="PropText">print GetAttr( "c:\test\autoexec.sav" )</p>
  38.   <p class="PropText">end</p>
  39.   <p class="PropText">ErrorHandler:</p>
  40.   <p class="PropText">Print Error</p>
  41.   <p class="PropText">end</p>
  42.   <p class="PropText">end sub</p>
  43.  </body></html>